package com.example.mykotilin.viewpager2

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.example.mykotilin.R
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator

class CardViewTabLayoutActivity : CardViewActivity() {
    private lateinit var tabLayout: TabLayout
    override val layoutId: Int = R.layout.activity_tablayout
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        tabLayout = findViewById(R.id.tabs)

        TabLayoutMediator(tabLayout, viewPager) { tab, position ->
            tab.text = Card.DECK[position].toString()
        }.attach()
    }

}